<?php
include './include/common.php';


if(!(isset($_GET['Y']) || isset($_GET['citypinyin']) )) exit('参数错误 ');
$_tmpy = $_GET['Y'];

$citypinyin = $_GET['citypinyin'];
$date = mktime(0,0,0,substr($_tmpy,4,2),substr($_tmpy,6,2),substr($_tmpy,0,4));		//日期
$Area = Getone_Area_Pinyin ( $citypinyin ); //地区详情

$Weather = gethistorydata($_tmpy,$citypinyin);
$v=$Weather;
$v['Weather'] = str_replace ( "@", "\\", $v['Weather'] );
$v['Weather'] = json_decode ( $v['Weather'], TRUE );
$urldate=substr($v['Update'],0,4).substr($v['Update'],5,2).substr($v['Update'],8,2);
$v['Weather'][2]!=$v['Weather'][6]&&$tadd="转{$v['Weather'][6]}";

$title=$Area['Ab'].substr($v['Update'],0,4)."年".substr($v['Update'],5,2)."月".substr($v['Update'],8,2)."日天气预报(".$v['Weather'][2].$tadd.",最高温度".$v['Weather'][1]."℃,最低温度".$v['Weather'][5]."℃)";


//$title = "{$parentArea['Ab']}{$Area[Ab]}天气预报|{$Area[Ab]}天气预报查询|{$Area[Ab]}未来三天(今天,明天,后天)天气预报查询-天气啦";
$keywords = "{$Area[Ab]}天气预报,{$Area[Ab]}天气预报查询";
$description = "天气啦(www.tianqi.la)实时提供{$parentArea['Ab']}{$Area[Ab]}气象局播报的{$Area[Ab]}天气预报今天,明天,后天未来三天天气预报,包括提供{$parentArea['Ab']}{$Area[Ab]}地区各区县未来3天的温度,降水量,湿度,风向等超准天气预报查询，让您的旅游出行更加放心!";
$title2 = "{$Area[Ab]}";
if ($Area ['parentid'] == '0' && $Area ['property'] == '1') {
	$daohang = "<a href=\"/\">天气预报查询网</a> > <a href=\"/quanguo/\">全国天气预报</a> > <a href=\"/{$Area[pinyin]}.html\">{$Area[Ab]}天气预报</a>";
} elseif ($Area ['parentid'] !== '0' && $Area ['property'] == '1' && $Area ['Level'] == '2') {
	$daohang = "<a href=\"/\">天气预报查询网</a> > <a href=\"/quanguo/\">全国天气预报</a> > <a href=\"/{$ppArea[pinyin]}sheng.html\">{$ppArea[name]}天气预报</a> > <a href=\"/{$Area[pinyin]}.html\">{$Area[Ab]}天气预报</a>";
} elseif ($Area ['parentid'] !== '0' && $Area ['property'] == '2' && $Area ['Level'] == '2') {
	$daohang = "<a href=\"/\">天气预报查询网</a> > <a href=\"/quanguo/\">全国天气预报</a> > <a href=\"/{$parentArea[pinyin]}.html\">{$parentArea[name]}天气预报</a> > <a href=\"/{$Area[pinyin]}.html\">{$Area[Ab]}天气预报</a>";
} elseif ($Area ['parentid'] !== '0' && $Area ['property'] == '2' && $Area ['Level'] == '3') {
	$daohang = "<a href=\"/\">天气预报查询网</a> > <a href=\"/quanguo/\">全国天气预报</a> > <a href=\"/{$ppArea[pinyin]}sheng.html\">{$ppArea[name]}天气预报</a> > <a href=\"/{$parentArea[pinyin]}.html\">{$parentArea[Ab]}天气预报</a> > <a href=\"/{$Area[pinyin]}.html\">{$Area[Ab]}天气预报</a>";
} else {
	$daohang = "<a href=\"/\">天气预报网</a> > <a href=\"/quanguo/\">全国天气预报</a> > <a href=\"/{$ppArea[pinyin]}sheng.html\">{$ppArea[name]}天气预报</a> > <a href=\"/{$parentArea[pinyin]}.html\">{$parentArea[Ab]}天气预报</a> > <a href=\"/{$Area[pinyin]}.html\">{$Area[Ab]}天气预报</a>";
}

var_dump($Weather,$title,$keywords,$description,$daohang);
	//				include template ( 'weather' ); //今日天气预报模版
	
?>